package com.hjt.zhibo.tag;

import java.io.IOException;
import java.util.List;

import javax.servlet.jsp.JspContext;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

import com.hjt.zhibo.model.PlatFormCatalog;

public class PlatFormCatalogTag extends SimpleTagSupport {
	
	private String platform;

	public void doTag() throws JspException, IOException {
		
		JspContext JspContext = this.getJspBody().getJspContext();
		List<PlatFormCatalog> list =PlatFormCatalog.dao.find("select * from platform_catalog t where t.platform=?", platform);
		
		 for (PlatFormCatalog platFormCatalog : list) {
			 JspContext.setAttribute("name", platFormCatalog.get("platform_cn_name"));
			 JspContext.setAttribute("url", platFormCatalog.get("platform_url"));
			 JspContext.setAttribute("id", platFormCatalog.get("platform_catalog_id"));
			 JspContext.setAttribute("prefix", platFormCatalog.get("prefix"));
			 this.getJspBody().invoke(null);
		 }
	}

	public void setPlatform(String platform) {
		this.platform = platform;
	}
	
}
